GSList *shortcuts;
GDBusProxy *hostnamed_proxy;
+ GCancellable *hostnamed_cancellable;
char *hostname;
GtkPlacesOpenFlags open_flags;
GError *error = NULL;
sidebar->hostnamed_proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ g_clear_object (&sidebar->hostnamed_cancellable);
+
if (error != NULL) {
g_debug ("Failed to create D-Bus proxy: %s", error->message);
g_error_free (error);
tree_view_set_activate_on_single_click (sidebar->tree_view);
sidebar->hostname = g_strdup (_("Computer"));
+ sidebar->hostnamed_cancellable = g_cancellable_new ();
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES,
NULL,
"org.freedesktop.hostname1",
"/org/freedesktop/hostname1",
"org.freedesktop.hostname1",
- NULL,
+ sidebar->hostnamed_cancellable,
hostname_proxy_new_cb,
sidebar);
}
g_clear_object (&sidebar->volume_monitor);
}
+ if (sidebar->hostnamed_cancellable != NULL) {
+ g_cancellable_cancel (sidebar->hostnamed_cancellable);
+ g_clear_object (&sidebar->hostnamed_cancellable);
+ }
+
g_clear_object (&sidebar->hostnamed_proxy);
g_free (sidebar->hostname);
sidebar->hostname = NULL;